﻿using System;
using System.Collections.Generic;

namespace eCommerce.db.DataRespository
{
    public class ArticleEntity
    {
        public int ArticleId { get; set; }
        public int CategoryId { get; set; }
        public string Title { get; set; }
        public string Sapo { get; set; }
        public string Body { get; set; }
        public string Source { get; set; }
        public string ImgAvatar { get; set; }
        public string Url { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime EditedOn { get; set; }
        public DateTime ApprovedOn { get; set; }
        public DateTime PublishOn { get; set; }
        public string CreatedBy { get; set; }
        public string EditedBy { get; set; }
        public string ApprovedBy { get; set; }
        public string LockedBy { get; set; }
        public int Status { get; set; }


        public string CategoryUrl { get; set; }
        public string ArticleUrl { get; set; }
        public string CategoryName { get; set; }
        public string FormatPublishOn { get; set; }        
        public string IconStatus { get; set; }
        
        private readonly Dictionary<string, object> _extendedProperties = new Dictionary<string, object>();
        public object this[string propertyName]
        {
            get
            {
                return (_extendedProperties.ContainsKey(propertyName) ? _extendedProperties[propertyName] : null);
            }
            set
            {
                if (_extendedProperties.ContainsKey(propertyName))
                {
                    _extendedProperties[propertyName] = value;
                }
                else
                {
                    _extendedProperties.Add(propertyName, value);
                }
            }
        }
    }
}
